/*
 * 
 */
package models.action;

import java.util.List;

/**
 * @author Tiancheng Zhang
 * @version 1.0
 *
 */
public class Action {
	/**
	 * Name of action
	 */
	private String name;
	
	/**
	 * Precondition of action
	 */
	private List<String> preCondition;

	/**
	 * Effect of action.
	 */
	private List<String> postCondition;

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the preCondition
	 */
	public List<String> getPreCondition() {
		return preCondition;
	}

	/**
	 * @param preCondition the preCondition to set
	 */
	public void setPreCondition(List<String> preDondition) {
		this.preCondition = preDondition;
	}

	/**
	 * @return the postCondition
	 */
	public List<String> getPostCondition() {
		return postCondition;
	}

	/**
	 * @param postCondition the postCondition to set
	 */
	public void setPostCondition(List<String> postCondition) {
		this.postCondition = postCondition;
	}
	
	
	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result
				+ ((postCondition == null) ? 0 : postCondition.hashCode());
		result = prime * result
				+ ((preCondition == null) ? 0 : preCondition.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Action other = (Action) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (postCondition == null) {
			if (other.postCondition != null)
				return false;
		} else if (!postCondition.equals(other.postCondition))
			return false;
		if (preCondition == null) {
			if (other.preCondition != null)
				return false;
		} else if (!preCondition.equals(other.preCondition))
			return false;
		return true;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "Action [name=" + name + ", preCondition=" + preCondition
				+ ", postCondition=" + postCondition + "]";
	}
	
}
